tle: “Data Visualization - Mini-Project 2” thor: “Jonathon Nazario
jnazario0512@floridapoly.edu” tput: html_document:
self_contained: true |
| df_print: paged |
This project explores and visualizes two datasets:
Florida Lakes Shapefile (spatial data)
Atlanta 2019 Daily Weather Data (CSV format)
The assignment goal was to use different data visualization techniques—including spatial, interactive, and model-based visualizations—to uncover trends and communicate insights effectively.
Initially, I aimed to create the following types of visualizations:
Spatial Map: Displaying water bodies in Florida using shapefiles from Natural Earth.
Interactive Plot: Using leaflet to build an interactive map of lakes in Florida, where clicking reveals the lake names.
Model-Based Visualization: Fitting a linear regression model to weather data to analyze how humidity and dew point affect daily high temperatures, and visualizing the model’s coefficients.
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(leaflet)
## Warning: package 'leaflet' was built under R version 4.4.3
library(sf)
## Warning: package 'sf' was built under R version 4.4.3
## Linking to GEOS 3.13.0, GDAL 3.10.1, PROJ 9.5.1; sf_use_s2() is TRUE
fl_lakes <- st_read("C:/Users/se08m/Downloads/dataviz_mini-project_02/dataviz_mini-project_02/data/Florida_Lakes/Florida_Lakes.shp")
## Reading layer `Florida_Lakes' from data source
## `C:\Users\se08m\Downloads\dataviz_mini-project_02\dataviz_mini-project_02\data\Florida_Lakes\Florida_Lakes.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 4243 features and 6 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: -87.42774 ymin: 25.02625 xmax: -80.03097 ymax: 31.00254
## Geodetic CRS: WGS 84
ggplot(fl_lakes) +
geom_sf(fill = "lightblue", color = "blue") +
theme_minimal() +
labs(title = "Lakes in Florida", caption = "Source: Florida_Lakes.shp")
leaflet(fl_lakes) %>%
addTiles() %>%
addPolygons(color = "blue", weight = 1, fillOpacity = 0.5,
popup = ~NAME)